<?php

namespace App\Http\Requests\Home;

use Illuminate\Foundation\Http\FormRequest;

class UserDoResetPwd extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'pwd'       => 'required|min:6|max:20|alpha_dash',
            'confirmPwd'=> 'required|min:6|max:20|alpha_dash',
        ];
    }

     public function messages()
    {
        return [

            'pwd.required'   => '请输入密码',
            'pwd.min'        => '密码最少6个字符',
            'pwd.max'        => '密码最多20个字符',
            'pwd.alpha_dash' => '请用字母、数字、破折号（ - ）以及下划线（ _ ）',

            'confirmPwd.required'    => '请输入确认密码',
            'confirmPwd.min'         => '密码最少6个字符',
            'confirmPwd.max'         => '密码最多20个字符',
            'confirmPwd.alpha_dash'  => '请用字母、数字、破折号（ - ）以及下划线（ _ ）',
        ];
    }
}
